export default () => {
  // 搜索配置
  const searchOption = ref({
    formConfig: {
      // 消费时间
      execTime: {
        label: "消费时间",
        component: "el-date-picker",
        type: "datetimerange",
        format: "YYYY-MM-DD HH:mm:ss",
        valueFormat: "YYYY-MM-DD HH:mm:ss",
      },
      // 应用名称
      serviceId: {
        label: "应用名称",
        component: "el-select",
        dicUrl: Api.application.serviceList,
        dicFormatter: res => {
          const list = Array.isArray(res.data) ? res.data.filter(item => item.id !== 4) : [];
          const newList = list.flatMap(item => item.serviceList);
          return newList.map(i => ({ label: i.serviceName, value: i.serviceId }));
        },
      },
      // 关联订单
      bizId: {
        label: "关联订单",
        component: "el-input",
      },
      // 消费对象
      consumer: {
        label: "消费对象",
        component: "el-input",
      },
      // 操作人员
      operator: {
        label: "操作人员",
        component: "el-input",
      },
    },
  });

  const tableOption = ref(
    Utils.tools.deleteSearchConfig({
      menu: false,
      column: {
        execTime: {
          label: "消费时间",
          minWidth: 170,
          type: "datetime",
          valueFormat: "YYYY-MM-DD HH:mm:ss",
        },
        serviceName: {
          label: "应用名称",
          minWidth: 160,
        },
        bizId: {
          label: "关联订单",
          minWidth: 160,
        },
        cost: {
          label: "成本金额(元)",
          minWidth: 160,
        },
        fee: {
          label: "消费金额(元)",
          minWidth: 160,
        },
        profit: {
          label: "利润金额(元)",
          minWidth: 160,
        },
        consumerAccount: {
          label: "扣款账户",
          minWidth: 160,
        },
        consumerName: {
          label: "消费对象",
          minWidth: 160,
        },
        operator: {
          label: "操作人员",
          minWidth: 160,
        },
      },
    })
  );
  return { searchOption, tableOption };
};
